package com.meet.app.service;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;

import androidx.annotation.Nullable;

import com.meet.framework.entity.Constants;
import com.meet.framework.manager.CloudManager;
import com.meet.framework.utils.LogUtils;
import com.meet.framework.utils.SpUtils;

public class CloudService extends Service {

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        linkCloudServer();
    }


    /**
     * 连接云服务
     */
    private void linkCloudServer() {
        //获取Token
        String token = SpUtils.getInstance().getString(Constants.SP_TOKEN, "");
        LogUtils.e("token:" + token);
        //连接服务
        CloudManager.getInstance().connect(token);
        //接收消息
        CloudManager.getInstance().setOnReceiveMessageListener((message, i) -> {

            return false;
        });
    }

}
